package GUI;

import csv.Export;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;

public class CSV报表界面 {
    private JFrame frame;
    private JComboBox comboBox1;
    private JPanel panel1;
    private JButton 确定Button;

    public CSV报表界面() {
        确定Button.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                String s=comboBox1.getSelectedItem().toString();
                if (s.equals("会员卡")){
                    JOptionPane.showMessageDialog(null, "确定生成会员卡报表嘛");
                    Export ex=new Export();
                    ex.exportToCsv会员卡();
                }
                else if (s.equals("消费记录")){
                    JOptionPane.showMessageDialog(null, "确定生成消费记录报表嘛");
                    Export ex=new Export();
                    ex.exportToCsv消费记录();
                }
            }
        });
    }

    public static void main(String[] args) {
        界面();
    }
    public static void 界面(){
        CSV报表界面 csv=new CSV报表界面();
        csv.frame=new JFrame("游泳管理系统");
        csv.frame.setContentPane(csv.panel1);
        csv.frame.setSize(500,400);
        csv.frame.setLocation(500, 200);
        csv.frame.setLocation(500, 200);
        csv.frame.setVisible(true);
        csv.frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
}
